<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
	</head>

	<body>
		<div >
			<!--页眉，放置标题-->
			
				<h1 id="title" s>很长一段标题，怎么滴也得</br>分一</br>个段落吧，不然不好看啊</h4>
			
			<!--内容区-->
				
				<img src="../image/8.png" style="height: 40vw; width: 100vw;" />
				<p id="content" style="font-size: x-large; color: #0086B3;">这里有很多的内容，哈哈哈哈哈哈哈哈哈哈哈哈哈
				wehjkshdjhsdkahjfkdjfkdsjfkdsjfkds
				减肥的空/\n间分开\\n
				kldfjaskldfjkjdfks</p>
			
			<!--页脚，放置补充信息或支持的操作-->
			<div class="mui-card-footer" id="time">
				发表时间：2019年5月21日21:35:31
			</div>
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/app.js"></script>
		<script type="text/javascript">
			mui.init();
			window.addEventListener('newsId',function(event){
				var id = event.detail.id;
				console.log(id);
				
				mui.plusReady(function(){
					plus.nativeUI.showWaiting('请稍候...');
					mui.ajax(app.serverUrl+'/notice/selectById',{
						data:{
							id:id
						},
						dataType:'json',//服务器返回json格式数据
						type:'post',//HTTP请求类型
						timeout:10000,//超时时间设置为10秒；
						success:function(data){
							plus.nativeUI.closeWaiting();
							console.log(JSON.stringify(data));
							loadContent(data.data);
							
						},
						error:function(xhr,type,errorThrown){
							
						}
					});
				});
			});
			function loadContent(data){
				var title = document.getElementById("title");
				var content = document.getElementById("content");
				var time = document.getElementById('time');
				title.innerHTML = data.title;
				var str = data.content;
				content.innerHTML = str;
				time.innerHTML = "发表时间："+data.publishtime;
			}
		</script>
	</body>

</html>
